package com.nicky.kids.Utility;

import android.os.Environment;

import java.io.File;

/**
 * Created by NickZhang on 9/11/13.
 */
public class SDCardUtil {
    private static final String TAG = "nick_SDCardUtil";
    private static final String KIDS = "Kids";

    public static File getRootDir() {
        File root = null;
        if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED) ) {
            root = Environment.getExternalStorageDirectory();
        }
        return root;
    }

    public static File getKidsDir() {
        File root = getRootDir();

        if (root == null) {
            return null;
        }

        File kids = new File(root, KIDS);
        if (!kids.exists()) {
            kids.mkdir();
        }
        return kids;
    }
}
